import os
import xml.etree.ElementTree as ET
from typing import List, Tuple


class Base:
    def __init__(
        self, root_path: str, version: List[str], auto_download: bool = True
    ) -> None:
        self.root_path = root_path
        self.class_list: List
        self.class_num = len(self.class_list)
        self._prepare_data(version, auto_download)

        self.train_images_list, self.train_labels_list = self._get_image_label_list(
            version, is_train=True
        )
        self.val_images_list, self.val_labels_list = self._get_image_label_list(
            version, is_train=False
        )

    def _prepare_data(self, version: str, auto_download: bool) -> None:
        raise NotImplementedError

    def _download(self, version: str) -> None:
        raise NotImplementedError

    def _convert(self, oral_path: str, save_path: str) -> None:
        raise NotImplementedError

    def _get_image_label_list(
        self, version: List[str], is_train: bool
    ) -> Tuple[List[str], List[str], List[str], List[str]]:
        raise NotImplementedError
